Distributed Tracing in Practice by Ben Sigelman & Jonathan Mace & Daniel Spoonhower & Austin Parker
Author:Ben Sigelman & Jonathan Mace & Daniel Spoonhower & Austin Parker [Ben Sigelman]
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2019-08-14T16:00:00+00:00
func main() { if len(os.Args) != 3 { panic("ERROR: Expecting two arguments! ftoc/ctof <value>") } tracer := lightstep.NewTracer() defer lightstep.Close() opentracing.SetGlobalTracer(tracer) requestObject := ConversionRequest{ Type := os.Args[1] Value := os.Args[2] } span := tracer.StartSpan("convertValue") span.setTag("operation", requestObject.Type) span.SetTag("initialValue", requestObject.Value) defer span.Finish() ctx := opentracing.ContextWithSpan(context.Background(), span) convertedValue := doConversion(ctx, requestObject) fmt.Println(convertedValue) }
One thing to note here is the usage of the opentracing.ContextWithSpan method. This is a helper function available to us in OpenTracing that adds the given span’s context to a Go context object. If you recall the section on intraprocess propagation, this is a convenient way to propagate context in Go that doesn’t require you to manually pass span contexts around. Indeed, if we look at our doConversion method, you can see how we’re using this -
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12580)
Hello! Python by Anthony Briggs(9918)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9797)
The Mikado Method by Ola Ellnestam Daniel Brolund(9780)
Dependency Injection in .NET by Mark Seemann(9342)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8303)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7765)
Grails in Action by Glen Smith Peter Ledbrook(7699)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7559)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7104)
Microservices with Go by Alexander Shuiskov(6873)
Practical Design Patterns for Java Developers by Miroslav Wengner(6785)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6731)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6420)
Angular Projects - Third Edition by Aristeidis Bampakos(6143)
The Art of Crafting User Stories by The Art of Crafting User Stories(5667)
NetSuite for Consultants - Second Edition by Peter Ries(5599)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5409)
Kotlin in Action by Dmitry Jemerov(5068)
